#include "Udpsever.hpp"

std::string defaulthandle(const std::string& message){
	std::string ret = "已经过处理，处理结果为： " + message;
	return ret;
}

// ./udpserver ip port
int main(int argc, char* argv[]){
	if(argc != 2){
		std::cerr<<"Usage: ./udpserver port"<<std::endl;
		return 1;
	}

	Enable_Console();
	uint16_t port = std::stoi(argv[1]);
	std::unique_ptr<UdpServer> server = std::make_unique<UdpServer>(port, defaulthandle);

	server->Init();
	server->Start();

	return 0;
}